<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3_5_1-3-数组对象绑定class</title>
</head>

<body>


    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

    <style>
        .red {
            color: red;
            font-size: 2em;
        }

        .font {
            font-weight: bold;
        }
    </style>

    <div id="app">
        <h1>数组对象</h1>
        <div :class="[redClass,fontClass]">
            示例文案
        </div>

    </div>

    <script>
        const App = {
            data() {
                return {
                    //数组
                    redClass: "red",
                    fontClass: "font",
                };
            },
        };
        Vue.createApp(App).mount("#app");
    </script>
</body>

</html>